// dlg.txt

//mark_quest_dest(zone,x,y,layer,quest);
//	code =
//		sf(,,2);
//		toggle_quest(19,10);
//		award_party_xp(MED_QUEST_XP);
//	break;

begintalkscript;

variables;

short this_town = 27;

begintalknode;
	tag = 1;
	condition = get_sdf(this_town,1) == 0;
	text1 = "The lowlands ahead are mainly swamp. This bowl in the Kranas terrain naturally draws water, which has resulted in an ancient, deep bog.";
	text2 = "You aren't surprised to find a mine here. Bog iron, natural iron deposits generated by peat bogs, are a good source of this precious metal. A clan of the Kranas works here, extracting the stuff.";
	text3 = "A nearby sign identifies this as the Silver Chief Mine. An odd name, but it's sure to have plenty of rich local history. You are more concerned with the many tracks of large beasts, which reach just outside of bowshot of the main clan hall.";
	code =
		sf(this_town,1,1);
	break;
	
begintalknode;
	tag = 2;
	condition = get_sdf(this_town,2) == 0;
	text1 = "You enter the mines, long shafts dug out of the bog and reinforced with heavy timbers. You don't see any signs of silver mining. Just piles of bog iron, kept in storage. The source of the Silver Chief Mine's name remains a mystery.";
	text2 = "In the shadows, you hear more hissing and growling. The remaining beasts have hidden down here, along with their mysterious master.";
	code =
		sf(this_town,2,1);
	break;

begintalknode;
	tag = 3;
	condition = get_sdf(this_town,3) == 0 && gf(27,11) > 0;
	text1 = "From this side of the growth blocking the road, you can see a path through. You grab a sickle and chop at it. Soon, you have cleared a proper path.";
	code =
		sf(this_town,3,1);
	break;

begintalknode;
	tag = 4;
	condition = get_sdf(this_town,4) == 0;
	text1 = "You round the corner and get a good look at the front of the mine's drying shed. You see two things of great interest.";
	text2 = "A young man in robes is standing at the door of the shed. He looks very surprised to see you. He ducks back through the door before you can get a good look.";
	text3 = "Past him, you see a horrifying animal tangle. Several enormous giant rats, their tails tied together. It is a Rat King, brought here to terrorize the mine. When the rats see you, they shriek. The water around you starts to bubble. Shapes begin to swim out of the filthy muck.";
	code =
		sf(this_town,4,1);
		
		spawn_creature(2739);
		set_summon_level(2739,1);
		spawn_creature(2742);
		set_summon_level(2742,1);
		spawn_creature(2744);
		set_summon_level(2744,1);
		
	break;

begintalknode;
	tag = 5;
	condition = get_sdf(this_town,5) == 0;
	text1 = "__";
	code =
		sf(this_town,5,1);
	break;

begintalknode;
	tag = 6;
	condition = get_sdf(this_town,6) == 0;
	text1 = "__";
	code =
		sf(this_town,6,1);
	break;

begintalknode;
	tag = 7;
	condition = get_sdf(this_town,7) == 0;
	text1 = "__";
	code =
		sf(this_town,7,1);
	break;

begintalknode;
	tag = 8;
	condition = get_sdf(this_town,8) == 0;
	text1 = "__";
	code =
		sf(this_town,8,1);
	break;

begintalknode;
	tag = 9;
	condition = get_sdf(this_town,9) == 0;
	text1 = "__";
	code =
		sf(this_town,9,1);
	break;

begintalknode;
	tag = 10;
	condition = get_sdf(this_town,10) == 0;
	text1 = "__";
	code =
		sf(this_town,10,1);
	break;

begintalknode;
	tag = 11;
	condition = get_sdf(this_town,11) == 0;
	text1 = "__";
	code =
		sf(this_town,11,1);
	break;

begintalknode;
	tag = 12;
	condition = get_sdf(this_town,12) == 0;
	text1 = "__";
	code =
		sf(this_town,12,1);
	break;

// MIXED

begintalknode;
	tag = 13;
	condition = 1;
	text1 = "All of the rats in the Rat King are finally dead. The bubbling water calms. The beasts on the surface have been dispatched. Some of the precious bog iron can now be safely claimed.";
	text2 = "You can return now and report a partial victory. The mines below you, alas, are still held by an unknown enemy.";

begintalknode;
	tag = 14;
	condition = 1;
	text1 = "There are several Kranas clan members working at this mine. They are cold and quiet, giving you only the briefest answers to your questions.";
	text2 = "They warn you to be careful. There are lots of monsters about. If you want to know more, you should talk to Cabieala, in the main tower.";
	text3 = "They are grateful that you took care of all of their monsters. Their thanks are brief and quiet, but sincere. If you want to know more, talk to Cabieala.";
	code =
		if (gf(27,12) == 0)
			rs(3);
			else rs(2);
	break;
	
begintalknode;
	tag = 15;
	condition = 1;
	text1 = "The door is stuck shut. You could probably pry it open, but only if you weren't distracted by rats flying at you from all directions.";

begintalknode;
	tag = 16;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 17;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 18;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 19;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 20;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 21;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 22;
	condition = 1;
	text1 = "__";

//// Cabieala

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "You meet the head of the clan that runs the Silver Chief Mine. She greets you with appropriate hospitality: a meal. Tea. A seat near the fire. However, even by Rokaj standards, she is a grim, silent woman.";
	text2 = "You pass the meal in utter silence as the younger clan members sneak up the hall to get a peek at you. All she says before the meal is, _I am Cabieala. You are allowed here. Sit and rest._";
	text3 = "Eventually, she rises, walks to the fire, and warms herself. She says, _We can talk now, Haven._";
	text5 = "Cabieala stands by the fire, alternating between warming her front and back. It's hard to stay dry and comfortable in this high swamp. With effort, you are able to converse with her.";
	action = INTRO;

begintalknode;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "_Tell me about this mine._";
	text1 = "_This is the Silver Chief Mine. It is my clan's legitimate claim._ Cabieala's voice is deep and slow. She is extremely spare with words to outsiders.";
	text2 = "_We have had troubles._";
	code =
		if (gf(27,12) > 0)
			rs(2);
	break;
	
begintalknode;
	state = 11;
	nextstate = 12;
	condition = 1;
	question = "_What do you mine here?_";
	text1 = "_Iron. We dig the iron of the bog. We are making tunnels under us to get at more of it._";

begintalknode;
	state = 12;
	nextstate = 11;
	condition = 1;
	question = "_Bog iron?_";
	text1 = "_Lumps of it form in these peat bogs. We can turn it into fine Kranas iron. It does not anger the groves._";

begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_How did this mine get its name?_";
	text1 = "_I don't know. The name was here before we were._";

begintalknode;
	state = 11;
	nextstate = 13;
	condition = 1;
	question = "_How did you get this claim?_";
	text1 = "_We got it in fair trade._";

begintalknode;
	state = 13;
	nextstate = 14;
	condition = 1;
	question = "_Trade?_";
	text1 = "_The clan here before us worked against Haven in secret, during the great Uprising. Haven found out and rooted them out. We received the claim in return for giving Haven iron._";

begintalknode;
	state = 14;
	nextstate = 15;
	condition = 1;
	question = "_Has Haven looked after you well?_";
	text1 = "_No. Haven should look after its vassals. For our troubles, we went to Governor Yvette. She demanded bribes. We offered them. Still none came, until you._";
	text2 = "That wasn't many words for what sounds like a long story.";

begintalknode;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "_You don't say a lot._";
	text1 = "_Correct._";

begintalknode;
	state = 10;
	nextstate = 16;
	condition = 1;
	question = "_I'd like to know more about the Kranas Woods._";
	text1 = "_This is not the place to learn it. We dig in the swamp._";
	
begintalknode;
	state = 16;
	nextstate = -1;
	condition = 1;
	question = "_There are a lot of troubles lately._";
	text1 = "_So I hear. We keep to ourselves up here. We learn as little as we can._";

begintalknode;
	state = 16;
	nextstate = -1;
	condition = 1;
	question = "_Your sacred groves are angry._";
	text1 = "_That is what I am told. The groves don't care about swamps at all. We are untouched by the rage. Though we still get problems._";
	text2 = "";

begintalknode;
	state = 16;
	nextstate = 17;
	condition = gf(80,8) >= 4;
	question = "_Your Raasa has been killed._";
	text1 = "_That news reached us. We know nothing about it._";

begintalknode;
	state = 17;
	nextstate = -1;
	condition = 1;
	question = "_Any thoughts on why?_";
	text1 = "_The rumor is that he was too close to Haven. I wouldn't know. We are swamp folk. We don't take part in high politics. We just send Yvette her iron and her bribes._";

begintalknode;
	state = 10;
	nextstate = 18;
	condition = gf(27,11) == 0 && gf(27,13) == 0;
	question = "_Is your mine productive now?_";
	text1 = "_No. We are unable to work. We told Yvette we would pay for her aid, and we went to safe, high land._";

begintalknode;
	state = 18;
	nextstate = 19;
	condition = 1;
	question = "_What happened?_";
	text1 = "_We were set upon by wild beasts. Rats and serpents. The old bodies in the deep swamp rose up. We didn't have the warriors to handle it. Go out in the swamp, and you will see._";

begintalknode;
	state = 19;
	nextstate = -1;
	condition = 1;
	question = "_What have you done about it?_";
	text1 = "_The Rokaj are warriors, but we have limits. There is the smell of magic in the attacks we received. My clan is strong. We can defend ourselves from outside, but not this._";
	text2 = "_We have waited long for Haven to remember us. We got you._";

begintalknode;
	state = 19;
	nextstate = -1;
	condition = 1;
	question = "_You offer a bounty for helping you?_";
	text1 = "_More like a bribe, paid to the hirelings of Governor Yvette. Still, we will pay. We have no choice. Talk to Chief Gyppius in [F2]. That is where the bribes are distributed._";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(27,11) > 0 && gf(27,13) == 0;
	question = "_I cleared out the nearby swamp._";
	text1 = "Cabieala nods. _The surface swamps are safer now. We can collect some iron. Chief Gyppius in [F2] will get the bribe, and some might be shared with you._";
	text2 = "_It is not the end of our problems, though._";
	code =
		sf(27,13,1);
	break;
	
begintalknode;
	state = 10;
	nextstate = 20;
	condition = gf(27,12) == 0 && gf(27,13) == 1;
	question = "_Is everything well here?_";
	text1 = "_This claim is still not our own. The surface is safe, but beasts still lurk in the caves._";

begintalknode;
	state = 20;
	nextstate = -1;
	condition = 1;
	question = "_How can I enter the tunnels?_";
	text1 = "_We have a shed to the north, for storing and baking the ore. There is a ladder into the depths there. I don't know what you will find._";

begintalknode;
	state = 20;
	nextstate = -1;
	condition = 1;
	question = "_Can I get another bribe?_";
	text1 = "_When we can produce iron in the caves, [F2] will get its share. You can claim it there._";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(27,12) > 0 && gf(27,13) == 1;
	question = "_The tunnels have been cleaned out._";
	text1 = "Cabieala is silent for a long moment. _We will produce more iron. We will send a share to [F2]. Haven has protected its vassals, and all we had to do was bribe you repeatedly and wait for weeks._";
	text2 = "_We are grateful to the mighty Empire of Haven._";
	code =
		sf(27,13,2);
	break;

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(27,13) > 1;
	question = "_Anything else keeping you from getting iron for us?_";
	text1 = "_No. We can work again. We are grateful. If we are attacked again, we will see how much of your help we can afford._";
	text2 = "_If our shipments haven't reached you yet, go back to [F2] and talk to Chief Gyppius._";
	
//

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 40;
	condition = 1;
	question = "Name";
	text1 = "There is a young Ro in long robes waiting for you in this cave. He is very calm, almost relaxed. The giant beasts flanking him probably help with this.";
	text2 = "When he sees the insignia on your shoulder, that raises his eyebrows. _A [P]? That is a surprise. Governor Yvette usually uses her bribes to hire thugs. She doesn't like to spend money to help the Ro, you know._";
	text3 = "_I am Phara. I have been contesting this claim. I will now end my effort._";
	
begintalknode;
	state = 40;
	nextstate = 41;
	condition = 1;
	question = "_End your effort?_";
	text1 = "_You have defeated me. Cabieala has shown she is capable of defending her claim. I have done my job. I will depart now._";

begintalknode;
	state = 40;
	nextstate = 41;
	condition = 1;
	question = "_You seem oddly unworried._";
	text1 = "_Why shouldn't I be? I was here on Rokaj business. That business is now concluded. I will depart._";

begintalknode;
	state = 40;
	nextstate = 41;
	condition = 1;
	question = "_You tried to kill me._";
	text1 = "_Well, obviously I didn't know it was you. If I'd known Cabieala had recruited royalty, I would have left right away. I'll certainly be going now._";

begintalknode;
	state = 41;
	nextstate = 42;
	condition = 1;
	question = "_Why are you here?_";
	text1 = "_I was hired. Cabieala's clan seemed to have a weak hold on this precious land. A rival thought they could drive her off. They hired me to test her. It is the way of the Rokaj. It keeps weaklings from holding precious land for too long._";

begintalknode;
	state = 42;
	nextstate = -1;
	condition = 1;
	question = "_Who sent you here?_";
	text1 = "_It was all arranged by intermediaries. I am sworn to silence. I will give no information. Again, standard Ro custom._";

begintalknode;
	state = 42;
	nextstate = -1;
	condition = 1;
	question = "_You know this is a claim of Haven?_";
	text1 = "_I knew Cabieala paid iron to our mighty masters. I imagine, if a new clan took over this land, they would have been forced to do the same. Not my business._";

begintalknode;
	state = 42;
	nextstate = -1;
	condition = 1;
	question = "_Why did you choose this line of work?_";
	text1 = "_I am an Erud normally, but it doesn't pay well. My clan needs funds, so here I am._";

begintalknode;
	state = 42;
	nextstate = -1;
	condition = 1;
	question = "_This is your job?_";
	text1 = "_At the moment. My skills find many uses._";

begintalknode;
	state = 42;
	nextstate = 43;
	condition = 1;
	question = "_Now I must deal with you._";
	text1 = "_That will be simple, won't it? I will pack up my supplies and leave. Your servant passed the test and will be more competent in the future. These challenges happen all the time here. This one is concluded. I will go._";
	text2 = "Hmmm. You doubt your mother would approve of releasing a wizard who attacked one of Haven's claims. Still, she's not here.";
	
begintalknode;
	state = 43;
	nextstate = -1;
	condition = 1;
	question = "_If you want me to let you go, I need payment._";
	text1 = "He shakes his head. _I stole nothing while here. All I am taking is what I brought. I will not let you steal it. I have my own honor to look after._";

begintalknode;
	state = 43;
	nextstate = -1;
	condition = 1;
	question = "_Where will you go if I release you?_";
	text1 = "_Not sure. Probably the Erudico tower. I can do some writing until another opportunity comes up. It's not the first time I've had to flee a raid. It's the way of the Ro._";

begintalknode;
	state = 43;
	nextstate = -1;
	condition = 1;
	question = "_Ever considered working for Haven?_";
	text1 = "He thinks about this. _Actually ... I might. I mean, not for Yvette. She is corrupt and, worse, cheap. I hear your Governor in the High Litha is competent. I might see if you have work for me. I know that Haven pays its servants on time._";

begintalknode;
	state = 43;
	nextstate = -1;
	condition = 1;
	question = "_You may go._";
	text1 = "He nods. It only takes him a minute to finish packing his equipment. _This is the way of the Ro. It will be remembered._ With a wave of his hand, the beasts by him fade away. He gives you a jaunty salute and disappears up the ladder.";
	text2 = "The troubles of the Silver Chief Mine have ended. It will now be able to provide you with iron with full efficiency.";
	action = END_TALK;
	code =
		kill_object(24,1);
		sf(27,15,1);
		sf(27,12,1);
		erase_char(30011);
		ro_faction(2);
		violence(-3);
		queen_faction(-3);
	break;
		
begintalknode;
	state = 43;
	nextstate = -1;
	condition = 1;
	question = "_You will pay the price for attacking Haven's supporters._ Attack.";
	text1 = "Phara is startled. _But ... That is not the way of the Ro! I thought you were part-Ro. I ... Ahhhh!_ And then he parries your attack. _Beasts, save me!_";
	action = END_TALK;
	code =
		set_attitude(30011,10);
		ro_faction(-2);
		violence(3);
		queen_faction(3);
	break;
	
//

begintalknode;
	tag = 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";


//

begintalknode;
	tag = 100;
	state = -1;
	nextstate = 100;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 100;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 130;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 130;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 160;
	state = -1;
	nextstate = 160;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 160;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
		
//

begintalknode;
	tag = 190;
	state = -1;
	nextstate = 190;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
				